package com.quectel.core.module.partybuildingsurvey.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 *
 * @author bob
 * @email bob.yu@quectel.com
 * @date 2023/05/24 11:38
 */
@Data
@Schema
public class PartySurveyQuestionDto implements Serializable {

    /**
    * id
    */
    @Schema(description = "id")
    private Long id;

    /**
    * 问卷id
    */
    @Schema(description = "问卷id")
    private Long partySurveyId;

    /**
     * 题目序号
     */
    @Schema(description = "题目序号")
    private Integer sort;

    /**
     * 是否必填 0非必填 1必填
     */
    @Schema(description = "是否必填")
    private Byte necessary;


    /**
    * 题目类型 字典值 1.单选题 2多选题 3.填空题 4.图片选择 5.评价
    */
    @Schema(description = "题目类型 字典值 1.单选题 2多选题 3.填空题 4.图片选择 5.评价")
    private Byte type;

    /**
    * 题目名称
    */
    @Schema(description = "题目名称")
    private String name;

    /**
     * 选项自定义配置
     */
    @Schema(description = "选项自定义配置")
    private String customAttr;

    /**
    * 创建时间
    */
    @Schema(description = "创建时间")
    private String createTime;


    @Data
    @Schema
    public static class MultipleConfig implements Serializable{
        /**
         * 多选最少选几个
         */
        @Schema(description = "多选最多选几个")
        private Integer minSelected;
        /**
         * 多选最多选几个
         */
        @Schema(description = "多选最多选几个")
        private Integer maxSelected;

    }

    /************非数据库字段 start ************/

    /**
     * 绑定的答题选项
     */
    @Schema(description = "绑定的答题选项")
    private List<PartySurveyAnswerDto> bindAnswer;


    /**
     * 答题记录
     */
    @Schema(description = "答题记录")
    private PartySurveyPersonAnswerDto partySurveyPersonAnswer;


    /**
     * 都选配置
     */
    @Schema(description = "都选配置")
    private MultipleConfig multipleConfig;


    /**
     * 答题人数
     */
    @Schema(description = "答题人数")
    private Long answerCount = 0L;

    /************非数据库字段 end **************/
}
